package algorithm.ldk.Array;

/**
 * @作者：ldk
 * @email 2505496685@qq.com
 * @描述：默认描述
 * @创建时间：8:39 2021-01-06
 * @修改时间：8:39 2021-01-06
 * @修改描述：默认描述
 */
public class Main {
    public static void main(String[] args) {

//        Array<Integer> arr = new Array<Integer>(20);
        Array<Integer> arr = new Array<Integer>();
        for (int i = 0; i < 10; i++) {
            arr.addLast(i);
        }
        System.out.println("-------------------------------------");
        System.out.println(arr);
        System.out.println("-------------------------------------");
        arr.add(1, 100);
        System.out.println(arr);
        System.out.println("-------------------------------------");
        arr.addFirst(-1);
        System.out.println(arr);
        System.out.println("-------------------------------------");

        //[-1, 0, 100, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        arr.remove(2);
        System.out.println(arr);
        //[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        System.out.println("-------------------------------------");

        arr.removeElement(4);
        System.out.println(arr);
        System.out.println("-------------------------------------");

        arr.removeFirst();
        System.out.println(arr);
        System.out.println("-------------------------------------");

        arr.removeLast();
        System.out.println(arr);
        System.out.println("-------------------------------------");



//          int[] arr = new int[20];
//        for (int i = 0; i < arr.length; i ++) {
//            arr[i] = i;
//        }
//
//        int[] scores = new int[]{100, 99, 66};
//        for (int i = 0; i < scores.length; i ++) {
//            System.out.println(scores[i]);
//        }
//        scores[0] = 98;
//        for (int i = 0; i < scores.length; i ++){
//            System.out.println(scores[i] );
//        }


    }
}
